﻿using Microsoft.Phone.Controls;

namespace TaxiPlease
{
	public partial class SettingsPage : PhoneApplicationPage
	{
		public SettingsPage()
		{
			InitializeComponent();

			this.DataContext = App.ViewModel;
		}

		protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
		{
			base.OnNavigatedTo(e);

			if (e.Uri.ToString().ToLower().Contains("about=true"))
			{
				this.pivot.SelectedIndex = 1;
			}
			else
			{
				this.pivot.SelectedIndex = 0;
			}
		}

		private void PhoneTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
		{
			(sender as PhoneTextBox).GetBindingExpression(PhoneTextBox.TextProperty).UpdateSource();
		}
	}
}